package reflect;

import reflect.annotation.AutoRunClass;
import reflect.annotation.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("sayHello");
        boolean flag = method.isAnnotationPresent(AutoRunMethod.class);
        if(flag){
            System.out.println("被标注");
        }else{
            System.out.println("未被标注");
        }
    }
}
